package com.bocloud.cmp.dao;

import java.util.List;
import java.util.Map;

import com.bocloud.cmp.entity.resource.Port;
import com.bocloud.common.model.Param;
import com.bocloud.common.model.SimpleBean;

/**
 * 端口管理DAO接口
 * 
 * @author dongkai
 *
 */
public interface PortDao {

    /**
     * 分页查询
     * 
     * @param page
     * @param rows
     * @param params
     * @param sorter
     * @return
     * @throws Exception
     */
    public List<Port> list(int page, int rows, List<Param> params, Map<String, String> sorter) throws Exception;

    /**
     * 简易查询
     * 
     * @param params
     * @param sorter
     * @return
     * @throws Exception
     */
    public List<SimpleBean> list(List<Param> params, Map<String, String> sorter) throws Exception;

    /**
     * 根据平台ID和子网ID查询
     * 
     * @param vendorId
     * @param subnetId
     * @return
     * @throws Exception
     */
    public List<Port> list(Long vendorId, String subnetId) throws Exception;

    /**
     * 根据平台ID查询
     * 
     * @param vendorId
     * @return
     * @throws Exception
     */
    public List<Port> listByVid(Long vendorId) throws Exception;

    /**
     * 查询数量
     * 
     * @param params
     * @return
     * @throws Exception
     */
    public int count(List<Param> params) throws Exception;

    /**
     * 保存
     * 
     * @param port
     * @return
     * @throws Exception
     */
    public Port save(Port port) throws Exception;

    /**
     * 删除
     * 
     * @param id
     * @return
     * @throws Exception
     */
    public boolean delete(Long id) throws Exception;

    /**
     * 根据平台ID删除
     * 
     * @param vendorId
     * @return
     * @throws Exception
     */
    public boolean removeByVid(Long vendorId) throws Exception;

    /**
     * 根据ID查询
     * 
     * @param id
     * @return
     * @throws Exception
     */
    public Port query(Long id) throws Exception;

    /**
     * 更新端口
     * 
     * @param port
     * @return
     * @throws Exception
     */
    public boolean update(Port port) throws Exception;

    /**
     * 删除端口
     * 
     * @param deviceId
     * @return
     * @throws Exception
     */
    public boolean removeByDeviceId(String deviceId) throws Exception;

}
